package website.seamonster.ethegg.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import website.seamonster.ethegg.dataobject.EggCounter;

import javax.transaction.Transactional;
import java.util.List;

/**
 * Created by 罗海量
 * 2018-07-20 01:32
 */
public interface EggCounterRepository extends JpaRepository<EggCounter, Long> {

    @Modifying
    @Transactional
    @Query(value = "update sys_egg_counter set CNT=CNT+?1", nativeQuery = true)
    void add(Long num);

}
